\section{Popobject.mui}

Popobject class takes a MUI object as parameter uses this one
as popup. You can e.g. simply create a listview object with
some entries and the popobject class will create a window
around it and display it when the user hits the popup button.

Using this class instead of creating the popup windows yourself
prevents you from having lots of problems. Think twice before
deciding to make you own popups!

\subsection[MUIA\_Popobject\_Follow]{MUIA\_Popobject\_Follow -- (V7) [ISG], BOOL}

\subsubsection*{FUNCTION}
Setting this attribute causes the popup window to follow its
parent window when its moved. Defaults to TRUE.

\subsubsection*{SEE ALSO}
MUIA\_Popobject\_Light, MUIA\_Popobject\_Volatile.

\subsection[MUIA\_Popobject\_Light]{MUIA\_Popobject\_Light -- (V7) [ISG], BOOL}

\subsubsection*{FUNCTION}
This attribute causes the popup window to be border and
titleless. Defaults to TRUE

\subsubsection*{SEE ALSO}
MUIA\_Popobject\_Follow, MUIA\_Popobject\_Volatile

\subsection[MUIA\_Popobject\_Object]{MUIA\_Popobject\_Object -- (V7) [I.G], Object $\ast$}

\subsubsection*{FUNCTION}
Specify the object to pop up. Usually this is a relatively simple
thing like a single listview, but you can of course use group
class here and make rather complex popups. As with all other
MUI classes, the object here gets disposed when the popobject
is disposed.

\subsubsection*{EXAMPLE}
\small
\begin{verbatim}
pop = PopobjectObject,
   MUIA_Popstring_String, KeyString(0,60,'n'),
   MUIA_Popstring_Button, PopButton(MUII_PopUp),
   MUIA_Popobject_StrObjHook, &StrObjHook,
   MUIA_Popobject_ObjStrHook, &ObjStrHook,
   MUIA_Popobject_Object, ListviewObject,
      MUIA_Listview_List, ListObject,
         InputListFrame,
         MUIA_List_SourceArray, PopNames,
         End,
      End,
   End;

\end{verbatim}
\normalsize
\subsubsection*{SEE ALSO}
MUIA\_Popobject\_StrObjHook, MUIA\_Popobject\_ObjStrHook,
MUIA\_Popobject\_Light

\subsection[MUIA\_Popobject\_ObjStrHook]{MUIA\_Popobject\_ObjStrHook -- (V7) [ISG], struct Hook $\ast$}

\subsubsection*{FUNCTION}
When a popup is closed, this hook is called. You can examine
the state of your MUIA\_Popobject\_Object and set the contents
of the string gadget respectively. The hook receives a pointer
to itself in A0, a pointer to your MUIA\_Popobject\_Object
in A2 and a pointer to the embedded string object in A1.

The hook will only be called when your popup is closed with
a success value of TRUE. Otherwise, MUI closes the popup
without taking further actions, just as if had never opened.

Since MUI doesn't know anything about your MUIA\_Popobject\_Object,
it's your task to tell when your popup is finished. You can
terminate popups at anytime by sending a MUIM\_Popstring\_Close
method:

{\bf A double click terminates the popping list with a successful
return value.}

DoMethod(plist,MUIM\_Notify,MUIA\_Listview\_DoubleClick,TRUE,
pop,2,MUIM\_Popstring\_Close,TRUE);

\subsubsection*{EXAMPLE}
\small
\begin{verbatim}
SAVEDS ASM VOID ObjStrFunc(REG(a2) Object *list,REG(a1) Object *str)
{
   char *x;
   DoMethod(list,MUIM_List_GetEntry,MUIV_List_GetEntry_Active,&x);
   set(str,MUIA_String_Contents,x);
}

\end{verbatim}
\normalsize
\subsection[MUIA\_Popobject\_StrObjHook]{MUIA\_Popobject\_StrObjHook -- (V7) [ISG], struct Hook $\ast$}

\subsubsection*{FUNCTION}
Before the popup opens, this hook is called. You can use it
to prepare your MUIA\_Popobject\_Object according to the
contents of the string gadget. The hook receives a pointer
to itself in A0, a pointer to your MUIA\_Popobject\_Object
in A2 and a pointer to the embedded string object in A1.

Return TRUE if you want the popup to appear,
FALSE otherwise.

\subsubsection*{EXAMPLE}
\small
\begin{verbatim}
SAVEDS ASM LONG StrObjFunc(REG(a2) Object *list,REG(a1) Object *str)
{
   char *x,*s;
   int i;

   get(str,MUIA_String_Contents,&s);

   for (i=0;;i++)
   {
      DoMethod(list,MUIM_List_GetEntry,i,&x);
      if (!x)
      {
         set(list,MUIA_List_Active,MUIV_List_Active_Off);
         break;
      }
      else if (!stricmp(x,s))
      {
         set(list,MUIA_List_Active,i);
         break;
      }
   }
   return(TRUE);
}

\end{verbatim}
\normalsize
\subsubsection*{SEE ALSO}
MUIA\_Popobject\_ObjStrHook, MUIA\_Popobject\_Object,
MUIA\_Popobject\_WindowHook

\subsection[MUIA\_Popobject\_Volatile]{MUIA\_Popobject\_Volatile -- (V7) [ISG], BOOL}

\subsubsection*{FUNCTION}
Setting this attribute causes the popup window to disappear when the
corresponding popobject disappears, e.g. because its in a page group
and the user toggled the page. When the popobject appears again,
the popup window appears also. Defaults to TRUE.

\subsubsection*{SEE ALSO}
MUIA\_Popobject\_Light, MUIA\_Popobject\_Follow

\subsection[MUIA\_Popobject\_WindowHook]{MUIA\_Popobject\_WindowHook -- (V9) [ISG], struct Hook $\ast$}

\subsubsection*{FUNCTION}
If specified, this hook is called immediately after the
popups window objects has been created but before this
window is opened. You might e.g. want to add a cycle
chain for the popup window here.

The hook is called with a pointer to the pop object
(MUIA\_Popobject\_Object) in A2 and with a pointer
to the window object that MUI generated to
handle the popup in A1.

\subsubsection*{EXAMPLE}
\small
\begin{verbatim}
/* pop is a simple listview, just set the windows
** default object to this to enable keyboard control */

SAVEDS ASM VOID WindowFunc(REG(a2) Object *pop,REG(a1) Object *win)
{
   set(win,MUIA_Window_DefaultObject,pop);
}

\end{verbatim}
\normalsize
\subsubsection*{SEE ALSO}
MUIA\_Popobject\_ObjStrHook, MUIA\_Popobject\_Object



